﻿using System.Runtime.Intrinsics.X86;

namespace _30_C_中的null_可空类型以及怎样判断null
{
    internal class Program
    {
        object obj;
        static void Main(string[] args)
        {
            Console.Title = "C#中的null";

            object obj;
            object obj1 = null;
            //if (obj == null)
            //{

            //}
            //if (obj1 == null)
            //{
            //    Console.WriteLine(obj1.ToString());
            //}
            //obj1 = obj1 == null ? "null" : obj1;
            //obj1 = obj1 ?? "null";
            //Console.WriteLine(obj1.ToString());

            //Person person = null;

            //Console.WriteLine(person?.Name);

            int? num = null;
            //int num1 = (int)num;
            Nullable<int> num2= null;

            bool? b1 = null;
            b1 = true;
            b1 = false;

            Console.ReadKey();
        }
    }
}
